package com.bdqn.wang.service.impl;


import com.bdqn.wang.dao.UserMapper;
import com.bdqn.wang.pojo.User;
import com.bdqn.wang.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public User loginUser(User user) {
        return userMapper.loginUser(user);
    }

    @Override
    public int count() {
        return userMapper.count();
    }

    @Override
    public List<User> findAll() {

        return userMapper.findAll();
    }

    @Override
    public User findUserById(Integer id) {
        return userMapper.findUserById(id);
    }

    @Override
    public List<User> findAllByCondition(User user) {
        return userMapper.findAllByCondition(user);
    }

    @Override
    public List<User> findAllByConditionAndPage(Integer address, Integer from, Integer pageSize) {
        return userMapper.findAllByConditionAndPage(address, from, pageSize);
    }

    @Override
    public int addUser(User user) {

        return userMapper.addUser(user);
    }

    @Override
    public int delUser(Integer id) {

        return userMapper.delUser(id);
    }

    @Override
    public int removeUsers(String[] ids) {

        return userMapper.removeUsers(ids);
    }

    @Override
    public int updateUser(User user) {

        return userMapper.updateUser(user);
    }
}
